<template>
  <div>
    <div class="header">
      <div @click="handlerclickleft">
        <slot name="left"></slot>
      </div>
      <div>{{ title }}</div>
      <div @click="handlerclickright">
        <slot name="right"></slot>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["title"],
  methods: {
    handlerclickleft(e) {
      this.$emit("click", e);
    },
    handlerclickright(e) {
      this.$emit("click", e);
    },
  },
};
</script>

<style lang="less" scoped>
.header {
  width: 100%;
  height: 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #ccc;
  > div:nth-child(1),
  div:nth-child(3) {
    padding: 0 10px;
  }
  > div:nth-child(2) {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
  }
  .van-icon-arrow-left {
    font-size: 20px;
  }
  .van-icon-wap-home {
    font-size: 24px;
  }
}
</style>
